<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <eHeader :dict="dict" :permission="permission" />
    </div>
    <!--表格渲染-->
    <el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
      <el-table-column type="selection" width="55" />
      <el-table-column prop="nickName" label="姓名" />
      <el-table-column prop="gender" label="性别" />
      <el-table-column prop="phone" label="电话" />
      <el-table-column prop="email" label="邮箱" />
      <el-table-column prop="deptName" label="部门" />
      <el-table-column prop="createTime" label="创建日期">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <!--   编辑与删除   -->
      <el-table-column
        v-permission="['admin']"
        label="操作"
        width="130px"
        align="center"
        fixed="right"
      >
        <div>
          <el-button @click="settingTeachTime">
            设置上课时间
          </el-button>
        </div>
      </el-table-column>
    </el-table>
    <!--分页组件-->
    <pagination />

  </div>
</template>

<script>
import crudTeacher from '@/api/teach/teacher'
import eHeader from './module/header'
import CRUD, { presenter } from '@crud/crud'
import pagination from '@crud/Pagination'

export default {
  name: 'Session',
  components: { eHeader, pagination },
  cruds() {
    return CRUD({
      title: '学期',
      url: 'api/teacher',
      sort: ['createTime,asc', 'id,desc'],
      crudMethod: { ...crudTeacher }
    })
  },
  mixins: [presenter()],
  // 数据字典
  dicts: ['session_type'],
  data() {
    return {
      permission: {

      }
    }
  },
  methods: {
    settingTeachTime() {
      console.log('settingTeachTime be clicked')
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-input-number .el-input__inner {
  text-align: left;
}
</style>
